#version 420

// Ouput data
layout(location = 0) out float fragmentdepth;
 
in vec2 UV;	// texture coord 
 
uniform sampler2D tex0; 
 
void main()
{
    // Not really needed, OpenGL does it anyway
	vec4 texel0;
	
	texel0 = texture( tex0, UV );
	
	if(texel0.a < 0.5)
    	discard;

    fragmentdepth = gl_FragCoord.z;
}